// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName*;
// import com.alibaba.druid.sql.ast.SQLObject*;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor*;

// import java.util.ArrayList;
// import java.util.std::list;

#include "SQLDropMaterializedViewStatement.h"

#include "../SQLName.h"
#include "../SQLObject.h"
#include "../../visitor/SQLASTVisitor.h"

SQLDropMaterializedViewStatement::SQLDropMaterializedViewStatement()
{
}

SQLDropMaterializedViewStatement::SQLDropMaterializedViewStatement(DbType_ptr  dbType)
    : SQLStatementImpl(dbType)
{
}

void SQLDropMaterializedViewStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLDropMaterializedViewStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLDropMaterializedViewStatement));
}

SQLName_ptr SQLDropMaterializedViewStatement::getName()
{
  return name;
}

void SQLDropMaterializedViewStatement::setName(SQLName_ptr x)
{
  if (x != NULL)
  {
    x->setParent(SharedObject(SQLDropMaterializedViewStatement));
  }
  this->name = x;
}

BOOL_ptr SQLDropMaterializedViewStatement::isIfExists()
{
  return ifExists;
}

void SQLDropMaterializedViewStatement::setIfExists(BOOL_ptr ifExists)
{
  this->ifExists = ifExists;
}

SQLObject_list_ptr  SQLDropMaterializedViewStatement::getChildren()
{
  SQLObject_list_ptr  children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != NULL)
  {
    children->push_back(std::dynamic_pointer_cast<SQLObject>(name));
  }
  return children;
}
